Technical Q&As
GXPD 04 - QuickDraw GX Printer Drivers & Configuration (1-May-95)
Q We want our printer drivers to be as consistent as possible with
Apple's implementations. Our present method of querying the printer for
configuration information, such as the number of trays and so on, is to send a
blank page to open the connection. I noticed that, in QuickDraw GX 1.1d2, you
query the printer for this information at DTP creation time. I'd like to see
some samples of Apple's code so I can get an idea of how you accomplish this. I
want to be sure I'm opening and closing the connection appropriately.
A In pre-1.1.1 versions of QuickDraw GX, printer queries caused some problems for
both our developers and our end users. While we don't have any code samples
from QuickDraw GX 1.1d2 we can show you, because all the code is currently in
our drivers, we can tell you how our drivers query the printer for
configuration information.
This is a relatively simple process. What you need to do is to override
GXDefaultDesktopPrinter. In your override module, you need to:
* Forward the message.
* Get the 'comm' resource from the DTP (use GXFetchTaggedData for this).
* If the 'comm' resource is a PAP resource (of type 'PPTL') then send the
following messages:
Send_GXOpenConnection
Send_SetupImageData
Send_GXCloseConnection
Bear in mind that this only works for a Postscript PAP case. If you're working on a
raster printer, you need to query the printer yourself, instead of sending the
SetupImageData message. Also, be sure to check the version of QuickDraw GX, as
this method only works on 1.1.1 or later.
Technical Q&As
Previous Question | Contents | Next Question